import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'

// const routes = [
//     {
//         path: '/',
//         name: 'root',
//         component:()=>import('@/views/root.vue'),
//         children: [
//             {
//                 path: '/home',
//                 name: 'home',
//                 component:()=>import('@/views/home/index.vue'),
//             },{
//                 path: '/contract',
//                 name: 'contract',
//                 component:()=>import('@/views/contract/index.vue'),
//             },{
//                 path: '/login',
//                 name: 'login',
//                 component:()=>import('@/views/login/login.vue'),
//             },
//         ]
//     }
// ]
//
// export const router = createRouter({
//     history:createWebHashHistory(),
//     linkActiveClass: 'active',  // 默认路由跳转
//     routes
// })

const routes:Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'home',
        component: () => import('@/views/home/index.vue'),
        alias: "home",
        meta: {
            title: "首页"
        }
    },
    {
        path: '/contract',
        name: 'contract',
        component: () => import('@/views/contract/index.vue'),
        alias: "contract",
        meta: {
            title: "联系人"
        }
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router;